﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace Water.Model
{
    public static class WriteSqlTotxt
    {
        public static void writesql(string sql)
        {
            try           
            {                
                FileStream aFile = new FileStream(@"E:\Log.txt", FileMode.OpenOrCreate); 
                StreamWriter sw = new StreamWriter(aFile);            
                //bool truth = true;              
                // Write data to file.               
                sw.WriteLine(sql);    
                //sw.WriteLine("It is now {0} and things are looking good.",   
                //    DateTime.Now.ToLongDateString());            
                //sw.Write("More than that,");             
                //sw.Write(" it's {0} that C# is fun.", truth);       
                sw.Close();      
            }          
            catch (IOException ex)    
            {            
                Console.WriteLine("An IOException has been thrown!");  
                Console.WriteLine(ex.ToString());    
                Console.ReadLine();             
                return;    
            }       
        }
    }
}
